package learn_202005;

import java.net.ServerSocket;
import java.net.Socket;

public class BIOMysqlServer {
    static  byte[] bs = new  byte[1024];
    public static void main(String[] arge){
        try {
            System.out.println("等待连接");
            ServerSocket serverSocket = new ServerSocket(9999);
            System.out.println("连接成功");
            while (true){
                // 阻塞
                Socket clientSocket = serverSocket.accept();
                clientSocket.getInputStream().read(bs);
                System.out.println(new String(bs));
            }
        }catch (Exception e){
            e.printStackTrace();
        }
    }
}
